package cn.kilo.trigger.job;

import cn.kilo.domain.model.order.vo.OrderStatusVO;
import cn.kilo.domain.repository.IStrategyRepository;
import cn.kilo.domain.service.infterface.IOrderStrategyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author kilok
 */

@Component
@Slf4j
public class TestJob {

    @Resource
    private IStrategyRepository repository;

    @Scheduled(cron = "0/5 * * * * ?")
    public void test(){
        log.info("test将未支付订单放入支付的队列");
        List<OrderStatusVO> waitPaySet = repository.getWaitPaySet();
        for(OrderStatusVO orderStatusVO:waitPaySet){
            repository.setOrderPayEd(orderStatusVO.getOrderId());
        }
    }
}
